import request from '@/utils/request'
import utils from '@/utils/util'

const imsApi = {
  // 查询列表
  getApplicationList(data) {
    const param = utils.dealGetData(data)
    return request.get('/api/inner/portal/applications' + param)
  },
  // 查询列表
  getSupplyByPage(data) {
    return request.post('/api/inner/ims/supplyMerchandiseGroup/list', data)
  },
  // 查询详情
  getSupplyMerchandiseGroupDetail(data) {
    return request.get('/api/inner/ims/supplyMerchandiseGroup/' + data)
  },
  // 修改分组
  updateSupplyMerchandiseGroup(data) {
    return request.post('/api/inner/ims/supplyMerchandiseGroup/update', data)
  },
  // 新增分组
  addSupplyMerchandiseGroup(data) {
    return request.post('/api/inner/ims/supplyMerchandiseGroup/save', data)
  },
  // 删除分组
  deleteSupplyMerchandiseGroup(id) {
    return request.post('/api/inner/ims/supplyMerchandiseGroup/delete/' + id)
  },
  // 原料未选择的全部列表
  materialList(data) {
    return request.post('/api/inner/ims/material/list', data)
  },
  // 已经选择的原料列表
  materialSelectedList(data) {
    return request.post('/api/inner/ims/material/selectedList', data)
  },
  // 选择原料
  materialSelect(data) {
    return request.post('/api/inner/ims/material/select', data)
  },
  // 删除已选择的原料
  materialUnSelect(data) {
    return request.post('/api/inner/ims/material/unSelect', data)
  },
  // 选择所有的原料
  materialSelectAll(data) {
    return request.post('/api/inner/ims/material/selectAll', data)
  },
  // 删除全部已选择的原料
  materialUnselectAll(data) {
    return request.post('/api/inner/ims/material/unselectAll', data)
  },
  // 货品类型
  materialTypes() {
    return request.get('/api/inner/ims/material/types')
  }

}

export default imsApi
